perm filename DIALOG.PUB[JC,MUS] blob sn#170872 filedate 1975-07-31 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00004 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	.DEVICE XGP
C00003 00003	.BEGIN CENTER
C00013 00004	.COMMAND CHARACTER "!"
C00026 ENDMK
C⊗;
.DEVICE XGP
.SPACING 10*5 MILLS;
.FONT 1 "BASL30"
.FONT 2 "BASI30"
.FONT 3 "BASB30"
.FONT 4 "BDR40"
.FONT 5 "FIX25"
.FONT 6 "BDI25"

.TURN ON "≡" FOR "%";
.PAGE FRAME 44 HIGH 78 WIDE
.TITLE AREA HEADING LINES 1 TO 2
.AREA TEXT LINES 3 TO 44
.PLACE HEADING
.SELECT 1
.PLACE TEXT
.NOJUST
.NOFILL
.SELECT 1
.NEXT PAGE
.TABS 9,17,25,33,41,49,57,65,73,81,89;
.AT "	" ⊂}\{⊃;
.TURN ON "\{}";
.BEGIN CENTER
≡4A TUTORIAL INTRO TO THE MUSIC PROGRAM≡1
.END
.BEGIN FILL ADJUST
MUS10 is a program which is used to generate a numerical representaion
of a sound-pressure wave.  The input to the program, supplied  by the user,
specifies in physical terms (eg. amplitude, frequency, spectrum)
the nature of the sound wave to be generated.  The output of the program is a
list of numbers, called samples, which are passed sequentially to a
digital-to-analog converter (DAC) which produces a signal
that is converted to a pressure-wave by means of a loudspeaker.  The power
of such a program is in the precision with which the pressure-wave can be
specified, while the labor for the user is to determine what constitutes
an effective specification.


SAMPLING AND QUANTIZING

In order to quickly arrive at a point where you can use MUS10 we will
begin with an informal overview of the sampling process and leave a
more rigorous examination of sampling and related problems until later.
An excellent overview exists in Mathews' book `The Technology of Computer
Music':

	INSERT

In order to specify the rapid changes of pressure in the wave of musical
sounds we must generate with the computer a large number of samples having a
sufficient number of bits to represent the amplitude of the pressure wave
at successive instants in time.  In this tutorial we will use the
number 10000 samples/sec = sampling rate (SR). (Samples/second is analogous
to frames/sec in cinema and 
while the `sampling rates' are vastly different in magnitude we will see that
there are many similarities between computer (digital) production of sound and
cinematic production of visual images, for example, both are a discrete
representation of continuous phenomena).

.PAGE FRAME 44 HIGH 88 WIDE;
.NEXT PAGE
.SELECT 2

A SIMPLE REPRESENTATION OF A COMPUTER OSCILATOR≡1

.SELECT 5

 20| 20| 20| 20| 20| 20 .....20| 20|-20|-20|-20|-20|-20|-20 .....-20|-20|
 ↑   ↑   ↑   ↑   ↑   ↑           ↑   ↑   ↑   ↑   ↑   ↑   ↑        ↑   ↑
 1   2   3   4   5   6      249 250 251 252 253 254 255 256      499 500
.SELECT 1


1    Take contents from 1st location of table
2    Send to DAC
3    Take contents from next location of table
4    Go to Step 2

We can see that  these four instructions will get us through the table
until the condition arises where there is no next location, that is,
when we arrive at location 500.  What we would like, however, is to go
back to the beginning of the table and repeat the process until we have
sent 10000 samples to the DAC (10000 samples represents one second of sound,
remember??).  We can make the following change in our directions, then:

1    Take contents from 1st location of table
2    Send to DAC
2.5  If the next location is greater than 500, Go to step 1, otherwise continue
3    Take contents from next location of table
4    Go to Step 2

Our directions now allow us to go through the table many times, in fact, the
obvious problem is that we must now stop the process after 10000 samples
have been sent to the DAC.  A solution might be:

0    Counter is set to 0
1    Take contents from 1st location of table
2    Send to DAC
2.2  Add 1 to Counter: if Counter is greater than 10000 Go to step 5, otherwise cont
2.5  If the next location is greater than 500, Go to step 1, otherwise continue
3.   Take contents from next location of table
4.   Go to Step 2
5.   STOP

Now, after having generated 10000 samples the process is stopped.  We will
have gone through the table 20 times (10000/500) and generated 20 periods
of the wave or a frequency of 20Hz.

We have now a perfectly acceptable "single frequency and amplitude oscilator".
What can we do if we want to produce a frequency of 40Hz at a different amplitude?

In regard to frequency our choices are either to change the sampling rate
or change the length of the table.
That is, we could run the DAC at 20000 samples/sec and STOP (go to 5) when
counter is greater than 20000; or, we can store the wave in a table which is
only 250 locations which would produce a frequency of 40Hz (10000/250=40).

Our choice will be to shorten the length of the table, but
in a somewhat special way.  The reasons that we choose not to change the sampling
rate will become clear later.

Now, rather than producing a wave table of 250 locations, we can have the
same effect by taking from every other location of the existing table of
500 locations.  That is, if we take the contents from the ≡3first≡1 location
and then skip the second and take next from the ≡3third≡1 location etc., then
in 250 steps we will have gone once through the table.  In the case of
20 Hz we stepped through the table by one while for 40 Hz we must step by
two.

.SELECT 5
 20| 20| 20| 20| 20| 20 .....20| 20|-20|-20|-20|-20|-20|-20 .....-20|-20|
 ↑       ↑       ↑           ↑       ↑       ↑       ↑            ↑
 1   2   3   4   5   6      249 250 251 252 253 254 255 256      499 500
.SELECT 1


If we want to generate a frequency of 80 Hz we need to step through the
table by four, where we take the first location, skip three, take the fifth
location, skip three, etc. where in 125 steps we will have gone through the
table and      10000/125=80 Hz!!!

.SELECT 5
 20| 20| 20| 20| 20| 20 .....20| 20|-20|-20|-20|-20|-20|-20 .....-20|-20|
 ↑               ↑                   ↑               ↑             
 1   2   3   4   5   6      249 250 251 252 253 254 255 256      499 500
.SELECT 1

Perhaps you are beginning to see that there is a direct relationship between
frequency and step size when the sampling rate and table length are constant.
That is, each time we doubled the step size we also doubled the frequency.




.COMMAND CHARACTER "!";
≡2L MA,JAM
≡5JOB 29    Stanford 7.01/P 07-06-75
Password = 
Tuesday	22-JUL-75	1153
There's a note for JAM
Read it now? 



 DISREGARD EARLIER REQUEST FOR RESUME AND CURRICULUM VITAE.HVA.

 WOULD WHOEVER HAS THE PROJECTS 3/8" ELECTRIC DRILL, PLEASE BRING
 IT BACK.   -  TED

 THIEVES HIT THE PARKING LOT AGAIN SAT. NIGHT.  MY 3-BAND BLAUPUNKT HAS
 FOUND ITS WAY TO THE 'MIDNIGHT AUTO SUPPLY'.  LOCK YOUR CAR!!! --- LCS

 New COPY allows abbreviating file hack names (names following backslash),
 and ] is optional except when programmer name omitted and comma follows.
 The \MAIL file hack has been flushed.  Use \MSG instead.

 Any students interested in entering the Berkeley-Stanford CS bake-off contact
 Dan Boley at Polya Hall or send an expression of interest to DLB.

 New COPY up with DIRECTORY switches /TIME /PROTECTION /DUMPED /OFFSET
 in addition to old /WRITER and /REFERENCED.  Directory output format improved.
 For details, R NEWS<cr>JULY<tab>DIR<cr>.  Bugs and complaints to ME.

 Two new WHO commands: T means TYPE OUT only the job information.
 F means TYPE OUT the job information plus the device list (F is for Files).

 Until the Ampex disk is successfully debugged, the system is liable to be down
 late afternoons and nights, reservations to the contrary notwithstanding.  REG

 WHO display commands can appear in monitor line on both TTYs & displays.

 If you need office supplies such as scissors or staplers, please see me and
 I will get you them, instead of ripping off the secretaries.....patte

 ETV users see EFIX[E,ALS] or posted copy for list of recent changes to ETV and
 for list of desired new features. Additions or corrections to ALS

 The HOME command in ETV has been modified so that it now returns you to the
 previous file whether readonly or readwrite, (but not to the <control>? file).



↑O21-JUL-75  1341		BPM,BPM	↑Y10173 
 Event of TUE 22-JUL-75
 There will be a demo of a Datamedia 1520A display terminal at 2 pm in the lounge

Today is PAYDAY!!!

5-DAY COMPUTER MAINTENANCE FORECAST:
  Tuesday: 1700, 1800: JBR;


EXIT
↑C
.≡2CREA	 TEST.F4≡5

00100		≡2X=2≡5
00200		≡2Y=3≡5
00300		≡2Z=X+Y≡5
00400		≡2TYPE 1,Z≡5
00500	≡21	FORMAT(F)≡5
00600		≡2END≡5
00700	≡2$≡5
*≡2E≡5

EXIT
↑C
.≡2EX TEST≡5

FORTRAN:  TEST.F4
LOADING

LOADER 5K CORE
EXECUTION

     5.0000000

EXIT
↑C
.≡2ED TEST.F4≡5

*≡2P≡5
00100		X=2
00200		Y=3
00300		Z=X+Y
00400		TYPE 1,Z
00500	1	FORMAT(F)
00600		END
*≡2R100≡5
00100		≡2ACCEPT 2,X,Y≡5
*≡2R200≡5
00200	≡22	FORMAT(2F)≡5
*≡2E≡5

EXIT
↑C
.≡2TYPE TEST.F4≡5

00100		ACCEPT 2,X,Y
00200	2	FORMAT(2F)
00300		Z=X+Y
00400		TYPE 1,Z
00500	1	FORMAT(F)
00600		END



EXIT
↑C
.≡2EX TEST≡5

FORTRAN:  TEST.F4
LOADING

LOADER 5K CORE
EXECUTION
≡22 3≡5

     5.0000000

EXIT
↑C
.≡2ED TEST≡5
EDITING TEST.F4

*≡2P≡5
00100		ACCEPT 2,X,Y
00200	2	FORMAT(2F)
00300		Z=X+Y
00400		TYPE 1,Z
00500	1	FORMAT(F)
00600		END
*≡2R300≡5
00300		X=X+Y
*≡2R400≡5
00400		TYPE 1,X
*≡2E≡5

EXIT
↑C
.≡2TY TEST.F4≡5

00100		ACCEPT 2,X,Y
00200	2	FORMAT(2F)
00300		X=X+Y
00400		TYPE 1,X
00500	1	FORMAT(F)
00600		END



EXIT
↑C
.≡2EX TEST≡5

FORTRAN:  TEST.F4
LOADING

LOADER 5K CORE
EXECUTION
≡22 3≡5

     5.0000000

EXIT
↑C
.≡2ED TEST≡5
EDITING TEST.F4

*≡2P≡5
00100		ACCEPT 2,X,Y
00200	2	FORMAT(2F)
00300		X=X+Y
00400		TYPE 1,X
00500	1	FORMAT(F)
00600		END
*≡2I50≡5
00050		≡2TYPE 3≡5
*≡2I60≡5
00060	≡23	FORMAT(' TYPE X AND Y'/)≡5
*≡2E≡5

EXIT
↑C
.≡2TY TEST.F4≡5

00050		TYPE 3
00060	3	FORMAT(' TYPE X AND Y'/)
00100		ACCEPT 2,X,Y
00200	2	FORMAT(2F)
00300		X=X+Y
00400		TYPE 1,X
00500	1	FORMAT(F)
00600		END



EXIT
↑C
.≡2EX TEST≡5

FORTRAN:  TEST.F4
LOADING

LOADER 5K CORE
EXECUTION

TYPE X AND Y

≡22 3≡5

     5.0000000

EXIT
↑C
.≡2ED TEST≡5
EDITING TEST.F4

*≡2P≡5
00050		TYPE 3
00060	3	FORMAT(' TYPE X AND Y'/)
00100		ACCEPT 2,X,Y
00200	2	FORMAT(2F)
00300		X=X+Y
00400		TYPE 1,X
00500	1	FORMAT(F)
00600		END
*≡2R50≡5
00050	≡210	TYPE 3≡5
*≡2I550≡5
00550		≡2GO TO 10≡5
*≡2E≡5

EXIT
↑C
.≡2TY TEST.F4≡5

00050	10	TYPE 3
00060	3	FORMAT(' TYPE X AND Y'/)
00100		ACCEPT 2,X,Y
00200	2	FORMAT(2F)
00300		X=X+Y
00400		TYPE 1,X
00500	1	FORMAT(F)
00550		GO TO 10
00600		END



EXIT
↑C
.≡2EX TEST≡5

FORTRAN:  TEST.F4
LOADING

LOADER 5K CORE
EXECUTION

TYPE X AND Y

≡22 3≡5

     5.0000000
TYPE X AND Y

≡25 6≡5

    11.0000000
TYPE X AND Y

≡23.14227 4.65773≡5

     7.8000000
TYPE X AND Y

↑C
↑C
↑C

.≡2DEL TEST.F4≡5

DELETED:TEST   F4
TOTAL SPACE RECLAIMED =     38  1 BLK  1%


EXIT
↑C
.≡2CREA TEST.F4≡5

00100≡2		FREQ=440.0≡5
00200≡2		RATIO=2.0**(1.0/12.0)≡5
00300≡2		TYPE 1,RATIO≡5
00400≡2	1	FORMAT(' RATIO = ',F)≡5
00500≡2		FREQ=FREQ*RATIO≡5
00600≡2		TYPE 2,FREQ≡5
00700≡2	2	FORMAT(' FREQUENCY = ',F)≡5
00800≡2		FREQ=FREQ*RATIO≡5
00900≡2		TYPE 2,FREQ≡5
01000≡2		FREQ=FREQ*RATIO≡5
01100≡2		TYPE 2,FREQ≡5
01200≡2		FREQ=FREQ*RATIO≡5
01300≡2		TYPE 2,FREQ≡5
01400≡2		END≡5
01500≡2	$≡5
*≡2E≡5

EXIT
↑C
.≡2EX TEST≡5

FORTRAN:  TEST.F4
LOADING

LOADER 6K CORE
EXECUTION

RATIO =       1.0594631
FREQUENCY =     466.1637600
FREQUENCY =     493.8832900
FREQUENCY =     523.2511200
FREQUENCY =     554.3652400

EXIT
↑C
.≡2ED TEST≡5
EDITING TEST.F4

*≡2P≡5
00100		FREQ=440.0
00200		RATIO=2.0**(1.0/12.0)
00300		TYPE 1,RATIO
00400	1	FORMAT(' RATIO = ',F)
00500		FREQ=FREQ*RATIO
00600		TYPE 2,FREQ
00700	2	FORMAT(' FREQUENCY = ',F)
00800		FREQ=FREQ*RATIO
00900		TYPE 2,FREQ
01000		FREQ=FREQ*RATIO
01100		TYPE 2,FREQ
01200		FREQ=FREQ*RATIO
01300		TYPE 2,FREQ
01400		END
*≡2D500:1300≡5
*≡2I500≡5
00500≡2		I=0≡5
00600≡2	100≡2	FREQ=FREQ*RATIO≡5
00700≡2		TYPE 2,FREQ≡5
00800≡2	2	FORMAT(' FREQUENCY = ',F)≡5
00900≡2		I=I+1≡5
01000≡2		IF (I.LE.12) GO TO 100≡5
01100≡2	$≡5
*≡2E≡5

EXIT
↑C
.≡2TYPE TEST.F4≡5

00100		FREQ=440.0
00200		RATIO=2.0**(1.0/12.0)
00300		TYPE 1,RATIO
00400	1	FORMAT(' RATIO = ',F)
00500		I=0
00600	100	FREQ=FREQ*RATIO
00700		TYPE 2,FREQ
00800	2	FORMAT(' FREQUENCY = ',F)
00900		I=I+1
01000		IF (I.LE.12) GO TO 100
01400		END



EXIT
↑C
.≡2EX TEST≡5

FORTRAN:  TEST.F4
LOADING

LOADER 6K CORE
EXECUTION

RATIO =       1.0594631
FREQUENCY =     466.1637600
FREQUENCY =     493.8832900
FREQUENCY =     523.2511200
FREQUENCY =     554.3652400
FREQUENCY =     587.3295100
FREQUENCY =     622.2539300
FREQUENCY =     659.2550700
FREQUENCY =     698.4564100
FREQUENCY =     739.9887700
FREQUENCY =     783.9907900
FREQUENCY =     830.6093000
FREQUENCY =     879.9998800
FREQUENCY =     932.3273900

EXIT
↑C
.≡2ED TEST≡5
EDITING TEST.F4

*≡2P≡5
00100		FREQ=440.0
00200		RATIO=2.0**(1.0/12.0)
00300		TYPE 1,RATIO
00400	1	FORMAT(' RATIO = ',F)
00500		I=0
00600	100	FREQ=FREQ*RATIO
00700		TYPE 2,FREQ
00800	2	FORMAT(' FREQUENCY = ',F)
00900		I=I+1
01000		IF (I.LE.12) GO TO 100
01400		END
*≡2R600≡5
00600≡2		FREQ=FREQ*RATIO≡5
*≡2D900:1000≡5
*≡2R700≡5
00700≡2	200	TYPE 2,FREQ≡5
*≡2R500≡5
00500≡2		DO 200 I=1,12≡5
*≡2P/.≡5

PAGE 1
00100		FREQ=440.0
00200		RATIO=2.0**(1.0/12.0)
00300		TYPE 1,RATIO
00400	1	FORMAT(' RATIO = ',F)
00500		DO 200 I=1,12
00600		FREQ=FREQ*RATIO
00700	200	TYPE 2,FREQ
00800	2	FORMAT(' FREQUENCY = ',F)
01400		END
*≡2E≡5

EXIT
↑C
.≡2EX TEST≡5

FORTRAN:  TEST.F4
LOADING
SWAP READ ERROR
↑C
.≡2EX TEST≡5

LOADING

LOADER 6K CORE
EXECUTION

RATIO =       1.0594631
FREQUENCY =     466.1637600
FREQUENCY =     493.8832900
FREQUENCY =     523.2511200
FREQUENCY =     554.3652400
FREQUENCY =     587.3295100
FREQUENCY =     622.2539300
FREQUENCY =     659.2550700
FREQUENCY =     698.4564100
FREQUENCY =     739.9887700
FREQUENCY =     783.9907900
FREQUENCY =     830.6093000
FREQUENCY =     879.9998800

EXIT
↑C
.